using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using kxcxw.Data.Entities;

namespace kxcxw.Data.Mapping
{
    public class SysUserInfoMap : EntityTypeConfiguration<SysUserInfo>
    {
        public SysUserInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.UserID);

            // Properties
            this.Property(t => t.UserID)
                .IsRequired()
                .HasMaxLength(36);

            this.Property(t => t.UserName)
                .HasMaxLength(20);

            this.Property(t => t.UserPwd)
                .HasMaxLength(16);

            this.Property(t => t.NickName)
                .HasMaxLength(20);

            this.Property(t => t.Email)
                .HasMaxLength(100);

            this.Property(t => t.Tel)
                .HasMaxLength(20);

            this.Property(t => t.IM)
                .HasMaxLength(15);

            this.Property(t => t.LastLoginIp)
                .HasMaxLength(20);

            this.Property(t => t.LastLoginDate)
                .HasMaxLength(20);

            this.Property(t => t.UserType)
                .HasMaxLength(36);
            // Table & Column Mappings
            this.ToTable("SysUserInfo");
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.UserName).HasColumnName("UserName");
            this.Property(t => t.UserPwd).HasColumnName("UserPwd");
            this.Property(t => t.NickName).HasColumnName("NickName");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.Tel).HasColumnName("Tel");
            this.Property(t => t.IM).HasColumnName("IM");
            this.Property(t => t.RegistrDate).HasColumnName("RegistrDate");
            this.Property(t => t.LastLoginIp).HasColumnName("LastLoginIp");
            this.Property(t => t.LastLoginDate).HasColumnName("LastLoginDate");
            this.Property(t => t.LoginNumber).HasColumnName("LoginNumber");
            this.Property(t => t.UserType).HasColumnName("UserType");
        }
    }
}

